﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using COFE.Core.Validater;
using COFE.Core;
using COFE.Core.EntryType;
using COFE.Core.Entry;

namespace COFE.Core
{
    /// <summary>
    /// {10-49} A list of properties for FileSystemInfo.
    /// </summary>
    public enum FileSystemInfoProperties : int
    {        
        /// <summary>
        /// Gets the path accessable in IO.
        /// </summary>
        [PropertyType(typeof(string))] 
        [FilePath]        
        FullName = 10,

        ///// <summary>
        ///// If the entries is virtual item, this WILL BE the path to access it, unlike FullName, 
        ///// TempPath does not attempt to expend the file or folder, FullName does.
        ///// Edit : Generated by FileSystemInfoExA now.
        ///// </summary>
        //[PropertyType(typeof(string))]
        //[FilePath]
        //TempPath,
        

        ///// <summary>
        ///// Get the path parsable by IUserProfile, implement either ParseName or FullParseName.
        ///// </summary>
        //[PropertyType(typeof(string))]
        //[FilePath]        
        //ParseName,

        /// <summary>
        /// Get the path parsable by IUserProfile, with directory volume. (e.g. {ListerID}\Path)
        /// </summary>
        [PropertyType(typeof(string))]
        [PrimaryProperty]
        [Metadata(false)]
        [Alias("Path")]        
        FullParseName,

        /// <summary>
        /// Get the parent path parsable by IUserProfile, required.
        /// </summary>
        [PropertyType(null, typeof(string))]
        [Metadata(false)]
        [Alias("ParentPath")]
        ParentParseName,

        /// <summary>
        /// Get the secondary directory lister key, which can obtain the directory lister from VolumeRegistrar.
        /// BTW, One can find the primary directroy lister key from it's FullParseName.
        /// </summary>
        [PropertyType("", typeof(string))]
        [PrimaryProperty]
        [Metadata(false)]
        [Alias("SecondaryId")]
        SecondaryVolumeKey,

        /// <summary>
        /// Gets the name of the entries
        /// </summary>
        [PropertyType(typeof(string))]
        [FileName]
        [Cachable]
        Name,

        /// <summary>
        /// Get the display label for the entries.
        /// </summary>
        [PropertyType(typeof(string))]        
        [Metadata(false)]
        [Alias("Label")]
        Label,

        /// <summary>
        /// Type of the entries.
        /// </summary>
        [PropertyType(typeof(string))]
        [Metadata]
        Type,

        /// <summary>
        /// Get whether the entries is exists.
        /// </summary>
        [PropertyType(typeof(bool))]
        [Metadata(false)]
        IsExists,

        /// <summary>
        /// Get whether the entries is cachable in database, or should be obtained from parse every time.
        /// </summary>
        [PropertyType(true)]
        [PrimaryProperty]
        IsCachable,

        /// <summary>
        /// Get FileAttribute (clone) of the entries.
        /// </summary>
        [PropertyType(typeof(FileAttributes), typeof(int))]
        [PrimaryProperty]
        FileAttributes,

        /// <summary>
        /// Get COFEAttribute of the entries.
        /// </summary>
        [PropertyType(typeof(COFEAttributes), typeof(int))]
        [PrimaryProperty]
        COFEAttributes,

        /// <summary>
        /// Get Creation time for an entries.
        /// </summary>
        [PropertyType(PropertyTypeAttribute.DateTimeDefaultEnum.Min)]
        [PrimaryProperty]
        CreationTimeUtc,

        /// <summary>
        /// Get Last write time for an entries.
        /// </summary>
        [PropertyType(PropertyTypeAttribute.DateTimeDefaultEnum.Min)]
        [PrimaryProperty]
        [Metadata(true)]
        [Alias("Time")]
        LastWriteTimeUtc,

        /// <summary>
        /// Get Last access time for an entries.
        /// </summary>
        [PropertyType(PropertyTypeAttribute.DateTimeDefaultEnum.Min)]
        [PrimaryProperty]
        LastAccessTimeUtc,

        /// <summary>
        /// Get whether current entries belong to a FileSystem.
        /// </summary>
        [PropertyType(true, typeof(bool))]
        [PrimaryProperty]
        IsFileSystem,

        /// <summary>
        /// Get parent of the current entries, optional.
        /// </summary>
        [PropertyType(typeof(IDirectoryInfo), typeof(DirectoryInfoExA))]
        Parent,

        /// <summary>
        /// Get a key which can be used in COFEShared.EntryTypeDictionary to lookup an EntryTypeInfo.
        /// </summary>
        [NotCachable]
        [PropertyType(typeof(Guid))]
        [Metadata]
        [Alias("EntryTypeId")]
        EntryTypeInfoKey,

        /// <summary>
        /// Get the EntryTypeInfo from DirectoryLister directly
        /// </summary>
        [NotCachable]
        [PropertyType(typeof(EntryTypeInfo))]
        EntryTypeInfo
    }
    

}
